//
//  ZYCSystemConfig.m
//  ZDSC
//
//  Created by ZDTX on 2021/6/22.
//

#import "ZYCSystemConfig.h"
#import <YYModel.h>

@implementation ZYCSystemConfig

+ (ZYCSystemConfig *)systemConfig{
    NSData * data = [[NSUserDefaults standardUserDefaults] objectForKey:NSStringFromClass([ZYCSystemConfig class])];
    if (data) {
        return [NSKeyedUnarchiver unarchiveObjectWithData:data];
    }else{
        return [[ZYCSystemConfig alloc] init];
    }
}

- (BOOL) saveSystemConfig{
    NSData * data = [NSKeyedArchiver archivedDataWithRootObject:self];
    [[NSUserDefaults standardUserDefaults] setObject:data forKey:NSStringFromClass([ZYCSystemConfig class])];
    return [[NSUserDefaults standardUserDefaults] synchronize];
}

#pragma mark - NSCoding Delegate
-(void) encodeWithCoder:(NSCoder *)coder{
    [self yy_modelEncodeWithCoder:coder];
}

-(id) initWithCoder:(NSCoder *)coder{
    self = [super init];
    return [self yy_modelInitWithCoder:coder];
}

-(id) init
{
    if (self = [super init]) {
        self.isWANNDownload = NO;
        self.isWifiPlay = NO;
        self.isRemoteNotification = YES;
    }
    return self;
}


@end
